import 'package:flutter/material.dart';
import 'package:flutter_fun_zjversion/config/net/lean_cloud_api.dart';

class AppRepository{

  ///轮播图接口
  static Future checkUpdate(String platform,String version) async{
    var response = await http.get('classes/appVersion',
        queryParameters: {'where':'{"platform":"$platform"}'});
    var result = response.data[0];
    debugPrint("当前版本=====>$version");
    debugPrint("最新版本为=====>${result['version']}");
    if (result['version'] != version) {
      return result['url'];
    }
    return null;
  }

  ///
  static Future isReview(String version) async{
    var response = await http.get("appStoreReview",queryParameters: {
      'version': version,
    });
    return response.data['review'];
  }
}